package com.macro.mall.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author xq
 * @description DelFlagEnums
 * @date 2023/12/29 9:39
 */
@Getter
@AllArgsConstructor
public enum DelFlagEnums {

    UNDELETED(0,"未删除"),
    DELETED(1,"已删除"),;

    private final Integer no;
    private final String desc;

    /**
     * 匹配枚举值
     *
     * @param id 名称
     * @return MailModuleEnum
     */
    public static DelFlagEnums of(Integer id) {
        if (id == null) {
            return null;
        }
        DelFlagEnums[] values = DelFlagEnums.values();
        for (DelFlagEnums moduleEnum : values) {
            if (moduleEnum.getNo().equals(id)) {
                return moduleEnum;
            }
        }
        return null;
    }

}
